import PropTypes from "prop-types";
function Comment({ a, b, c }) {
	// changeFn(){
		
	// }
	return (
		<div>
			<p>
				公式：
				{a}
				{c}
				{b}
			</p>
			<h3>
				结果：
				{c == "+"
					? a + b
					: c == "-"
					? a - b
					: c == "/"
					? a / b
					: c == "x"
					? a * b
					: ""}
			</h3>
			<div className='plan'>
				<ul className='numbers'>
					<li
						onClick={() => {
							props.changeFn();
						}}>
						1
					</li>
			
				</ul>
				<ul className='compute'>
					<li
						onClick={() => {
							c = "+";
						}}>
						+
					</li>
					<li
						onClick={() => {
							c = "-";
						}}>
						-
					</li>
					<li
						onClick={() => {
							c = "x";
						}}>
						x
					</li>
					<li
						onClick={() => {
							c = "/";
						}}>
						/
					</li>

					<li>=</li>
				</ul>
			</div>
		</div>
	);
}
Comment.propTypes = {
	a: PropTypes.number,
	b: PropTypes.number,
};
export default Comment;
